package com.gang.mars.basic.jdk18.modifier;

import java.lang.reflect.Modifier;

public class Pitaya01 {

    public static void main(String[] args) {
        test01();
        test02();
    }

    public static void test01 (){
        try {
            Class<?> pitaya01 = Class.forName("com.gang.mars.basic.jdk18.modifier.Pitaya01");
            int modifiers = pitaya01.getModifiers();
            System.out.println("public modifiers= " + modifiers);
            boolean aPublic = Modifier.isPublic(modifiers);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static  void test02(){
        try {
            Class<?> aClass = Class.forName("com.gang.mars.basic.jdk18.modifier.Pitaya01$Pitaya02");
            int modifiers = aClass.getModifiers();
            System.out.println("private modifiers =" + modifiers);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

    private class  Pitaya02{
    }

    protected class  Pitaya03{

    }
}
